<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-bind的使用1</title>
    <script src="js/vue.js"></script>
    <style>
        .myimg{
            border:2px solid #000000; 
            border-radius: 50px;
        }
        .youimg{
            border:2px dashed pink;
            border-radius: 50px;
            transform:rotate(45deg)
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="changePic">变图</button><br>
        <img v-bind:src="imagePath" :class="defaultClass" @mouseover="changeCls" @mouseout="changeCls2">
    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
            imagePath:'images/userface4.jpg',
            defaultClass:'myimg'
        },
        methods: {
            changePic:function(){
                this.imagePath='images/userface5.jpg'
            },
            changeCls:function(){
                this.defaultClass='youimg';
            },
            changeCls2:function(){
                this.defaultClass='myimg';
            }
        },
    });
</script>